package com.zdb.demo.design.pattern.structural.composite;

public class CatalogComponent {

    public void add(CatalogComponent catalogComponent) {
        throw new UnsupportedOperationException("不支持添加操作");
    }

    public void remove(CatalogComponent catalogComponent) {
        throw new UnsupportedOperationException("不支持删除操作");
    }

    public String getName() {
        throw new UnsupportedOperationException("不支持获取名称操作");
    }

    public double getPrice() {
        throw new UnsupportedOperationException("不支持获取价格操作");
    }

    public void print() {
        throw new UnsupportedOperationException("不支持打印操作");
    }

    protected void printByLevel(int level) {
        throw new UnsupportedOperationException("不支持层级打印操作");
    }

    protected void printN(String str, int cnt) {
        for (int i = 0; i < cnt; i++) {
            System.out.print(str);
        }
    }
}
